import 'package:flutter/material.dart';
import 'package:flutterdemo/day02/01_statelesswidget.dart';
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // 启动要显示的界面
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("图标组件示例"),
      ),
      body: JKHomeContent(),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {
          print("FloatingActionButton Click");
        },
      ),
    );
  }
}

class JKHomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        // 1.RaisedButton
        RaisedButton(
          child: Text("RaisedButton"),
          textColor: Colors.red,
          color: Colors.brown,
          onPressed: () {
            print("RaisedButton Click");
          },
        ),
        // 2.FlatButton
        FlatButton(
          child: Text("FlatButton"),
          color: Colors.red,
          onPressed: () {
            print("FlatButton Click");
          },
        ),
        // 3.OutlineButton
        OutlineButton(
          child: Text("OutlineButton"),
          color: Colors.red,
          onPressed: () {
            print("FlatButton Click");
          },
        ),
        // 5.
        FlatButton(
          color: Colors.amberAccent,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(6.0)
          ),
          child: Row(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              Icon(Icons.favorite, color: Colors.red,),
              Text("喜欢你")
            ],
          ),
          onPressed: () {
            print("自定义FlatButton Click");
          },
        )
      ],
    );
  }
}


